import request from '@/util/request'
import store from '@/vuex/store'

// 查询家庭成员列表
export function getFamilyMenberByBiidApi(applyCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: applyCode
    }
    return request({
        url: 'bnFamily/getFamilyListByBid.do',
        method: 'post',
        data: value
    })
}

//updataFamilyApi
export function updataFamilyApi(family){
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(family)
    }
    return request({
        url: 'bnFamily/updateFamily.do',
        method: 'post',
        data: value
    })
}

//addFamilyMemberApi
export function addFamilyMemberApi(family){
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(family)
    }
    return request({
        url: 'bnFamily/addFamilyMember.do',
        method: 'post',
        data: value
    })
}

//deleteFamilyApi 删除
export function deleteFamilyByIdCardApi(idCard){
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(idCard)
    }
    return request({
        url: 'bnFamily/deleteFamilyByIdCard.do',
        method: 'post',
        data: value
    }) 
}